<?php
require_once('Zend/View/Helper/Abstract.php');

class Kbs_View_Helper_Brower extends Zend_View_Helper_Abstract
{
    CONST IE        = 'ie';
    CONST FIREFOX   = 'firefox';
    CONST CHROME    = 'chrome';
    CONST SAFARI    = 'safari';
    CONST OPERA     = 'opera';

    public function brower()
    {
        $brower = self::IE;
        $agent = $_SERVER['HTTP_USER_AGENT'];
        if (false !== strpos($agent, 'Firefox')) {
            $brower = self::FIREFOX;
        } elseif (false !== strpos($agent, 'Chrome')) {
            $brower = self::CHROME;
        } elseif (false !== strpos($agent, 'Safari')) {
            $brower = self::SAFARI;
        } elseif (false !== strpos($agent, 'Opera')) {
            $brower = self::OPERA;
        } else {
            $brower = self::IE;
        }
        return $brower;
    }
}